<div [@routerTransition]>
        <div class="m-subheader ">
            <div class="d-flex align-items-center">
                <div class="mr-auto col-xs-6">
                    <h3 class="m-subheader__title m-subheader__title--separator">
                        <span>任务工时</span>
                    </h3>
                    <span class="m-section__sub">
                        任务工时的文本头信息
                    </span>
                </div>
                <div class="col-xs-6 text-right">
                <button (click)="createOrEditTaskworkingModal.show()" class="btn btn-primary blue" *ngIf="isGranted('Mes51.Pages.Workingtime.Taskworking.Edit')">
                    <i class="fa fa-plus"></i> 编辑
                </button>
            </div>
            </div>
        </div>

        <div class="m-content">
            <div class="m-portlet m-portlet--mobile">
                <div class="m-portlet__body">
                        <div class="tabbable-line">
                    <form class="horizontal-form" autocomplete="off">
                        <div class="m-form m-form--label-align-right">
                            <div class="row align-items-center m--margin-bottom-10">
                                <div class="col-xl-12">
                                    <div class="form-group m-form__group align-items-center">
                                        <div class="input-group">
                                            <input [(ngModel)]="filterText" name="filterText" autoFocus
                                                class="form-control m-input" [placeholder]="l('SearchWithThreeDot')"
                                                type="text">
                                            <span class="input-group-btn">
                                                <button (click)="getWorking()" class="btn btn-primary" type="submit">
                                                    <i class="flaticon-search-1" [attr.aria-label]="l('Search')"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row m--margin-bottom-10" style="padding: 0 20px;" [hidden]="!advancedFiltersAreShown">
                                    <div class="form-group col-md-6">
                                            <label for="StartEndRange" class="control-label">{{"DateRange" | localize}}</label>
                                            <input class="form-control"
                                            style="width: 80%;"
                                                   id="StartEndRange"
                                                   name="StartEndRange"
                                                   #drp="bsDaterangepicker"
                                                   readonly="readonly"
                                                   bsDaterangepicker
                                                   dateRangePickerInitialValue
                                                   [(ngModel)]="dateRange">
                                        </div>
                                </div>
                            <div class="row margin-bottom-10" *ngIf="advancedFiltersAreShown">
                                <div class="col-sm-12 text-right">
                                    <button class="btn btn-metal" (click)="remWorking()"><i class="fa fa-refresh"></i>
                                        {{l("Refresh")}}</button>
                                </div>
                            </div>
                            <div class="row margin-bottom-10">
                                    <div class="col-sm-12">
                                            <span class="clickable-item text-muted" *ngIf="!advancedFiltersAreShown"
                                                (click)="advancedFiltersAreShown = !advancedFiltersAreShown">
                                                <i class="fa fa-angle-down"></i> {{ l('ShowAdvancedFilters') }}</span>
                                            <span class="clickable-item text-muted" *ngIf="advancedFiltersAreShown"
                                                (click)="advancedFiltersAreShown = !advancedFiltersAreShown">
                                                <i class="fa fa-angle-up"></i> {{ l('HideAdvancedFilters') }}</span>
                                        </div>
                            </div>
                        </div>
                    </form>

                    <div class="row align-items-center" style="padding: 0 14px;">
                        <!--<Primeng-TurboTable-Start>-->
                        <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                            <p-table #dataTable (onLazyLoad)="getWorking($event)" [value]="primengTableHelper.records"
                                rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                                [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                                [resizableColumns]="primengTableHelper.resizableColumns">
                                <ng-template pTemplate="header">
                                    <tr>
                                        <th style="width: 130px;" *ngIf="isGranted('Mes51.Pages.Workingtime.Taskworking.Delete')"></th>
                                        <th style="width: 170px;">任务号</th>
                                        <th style="width: 150px;">图号</th>
                                        <th style="width: 120px;">任务名称</th>
                                        <th style="width: 120px;">人员姓名</th>
                                        <th style="width: 120px;">工序名称</th>
                                        <th style="width: 120px;">个人工时</th>
                                        <th style="width: 120px;">所占比例</th>
                                        <th style="width: 120px;">完成时间</th>
                                        <th style="width: 120px;">主制班组</th>
                                    </tr>
                                </ng-template>
                                <ng-template pTemplate="body" let-record="$implicit">
                                    <tr>
                                        <td style="width: 130px" *ngIf="isGranted('Mes51.Pages.Workingtime.Taskworking.Delete')">
                                                <div class="btn-group dropdown" dropdown container="body">
                                                    <button dropdownToggle
                                                        class="dropdown-toggle btn btn-sm btn-primary">
                                                        <i class="fa fa-cog"></i><span class="caret"></span>
                                                        {{ "Actions" | localize }}
                                                    </button>
                                                    <ul class="dropdown-menu" *dropdownMenu>
                                                        <!-- <li>
                                                            <a (click)="createOrEditTaskworkingModal.show(record.id,1)">编辑</a>
                                                        </li> -->
                                                        <li>
                                                            <a (click)="deleteModel(record.id)">删除</a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </td>
                                        <td style="width: 170px;">{{record.taskCode}}</td>
                                        <td style="width: 150px;">{{record.drawNum}}</td>
                                        <td style="width: 120px;">{{record.taskName}}</td>
                                        <td style="width: 120px">{{ record.userName}}</td>
                                        <td style="width: 120px">{{ record.nodeName}}</td>
                                        <td style="width: 120px">{{ record.timePercentage * record.workingTime / 100}}</td>
                                        <td style="width: 120px">{{ record.timePercentage}}</td>
                                        <td style="width: 120px;">
                                            {{record.creatTime | momentFormat:'YYYY-MM-DD'}}
                                        </td>
                                        <td style="width: 120px">{{ record.orgName}}</td>
                                        <!-- <td style="width: 80px;">
                                                <button type="button" class="btn btn-sm m-btn m-btn--gradient-from-danger m-btn--gradient-to-warning"
                                                (click)="taskworkingDetailModal.show(record.pipelineId)">
                                                详细
                                              </button>
                                        </td> -->
                                    </tr>
                                </ng-template>
                            </p-table>
                            <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                                {{l('NoData')}}
                            </div>
                            <div class="primeng-paging-container">
                                <p-paginator rows="{{primengTableHelper.defaultRecordsCountPerPage}}" #paginator
                                    (onPageChange)="getWorking($event)"
                                    [totalRecords]="primengTableHelper.totalRecordsCount"
                                    [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                                </p-paginator>
                                <span class="total-records-count">
                                    共计：{{primengTableHelper.totalRecordsCount}}
                                </span>
                            </div>
                        </div>
                        <!--<Primeng-TurboTable-End>-->
                    </div>
                </div>
                </div>
            </div>
        </div>
        <createOrEditTaskworkingModal #createOrEditTaskworkingModal (modalSave)="getWorking()"></createOrEditTaskworkingModal>
    </div>
